import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * Created by zzy on 2017/12/29.
 */
public class lmad {
    public static void main(String[] args) {
        List<order> orderList=new ArrayList<>();
        order order1=new order(1);
        order order2=new order(2);
        orderList= Arrays.asList(order1,order2);
/*        orderList.stream().map(p ->order.getOrder() ).collect(Collectors.toList());*/
        System.out.println(orderList);
        orderList.stream().forEach(p->p.setNumber2(p.getNumber1()));
        System.out.println(orderList);
    }


}
class order{
    private int number1;

    private int number2;

    public order(int number1) {
        this.number1 = number1;
    }

    public int getNumber1() {
        return number1;
    }

    public void setNumber1(int number1) {
        this.number1 = number1;
    }

    public int getNumber2() {
        return number2;
    }

    public void setNumber2(int number2) {
        this.number2 = number2;
    }

    @Override
    public String toString() {
        return "order{" +
                "number1=" + number1 +
                ", number2=" + number2 +
                '}';
    }
}
